LOCAL_PATH := $(call my-dir)

#libjthread

include $(CLEAR_VARS)

JTHRD_PATH := prebuild/libjthread

LOCAL_SRC_FILES := $(JTHRD_PATH)/src/jmutex.cpp \
                   $(JTHRD_PATH)/src/jthread.cpp
 
LOCAL_CFLAGS += -DHAVE_PTHREAD \
                -DENABLE_TRACE 
                
LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(JTHRD_PATH)/include $(LOCAL_PATH)/$(JTHRD_PATH)/src

LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)

#LOCAL_PRELINK_MODULE := false

LOCAL_LDLIBS += -ldl -llog
 
LOCAL_MODULE:= jthread

include $(BUILD_STATIC_LIBRARY)

#libjrtp

include $(CLEAR_VARS) 

JRTP_PATH := prebuild/libjrtp

LOCAL_SRC_FILES := $(JRTP_PATH)/src/rtpconnection.cpp \
								$(JRTP_PATH)/src/rtpcontributingsources.cpp \
								$(JRTP_PATH)/src/rtpdebug.cpp \
								$(JRTP_PATH)/src/rtpdestlist.cpp \
								$(JRTP_PATH)/src/rtperror.cpp \
								$(JRTP_PATH)/src/rtphandlers.cpp \
								$(JRTP_PATH)/src/rtpiptable.cpp \
								$(JRTP_PATH)/src/rtplocalinfo.cpp \
								$(JRTP_PATH)/src/rtpmcasttable.cpp \
								$(JRTP_PATH)/src/rtppacket.cpp \
								$(JRTP_PATH)/src/rtppacketprocessor.cpp \
								$(JRTP_PATH)/src/rtprandom.cpp \
								$(JRTP_PATH)/src/rtprtcpmodule.cpp \
								$(JRTP_PATH)/src/rtpsession.cpp \
								$(JRTP_PATH)/src/rtpsourcedata.cpp \
								$(JRTP_PATH)/src/rtpsourcedescription.cpp \
								$(JRTP_PATH)/src/rtpsources.cpp \
								$(JRTP_PATH)/src/rtpsrclist.cpp \
								$(JRTP_PATH)/src/rtptimeutil.cpp
															
#$($(wildcard $(LOCAL_PATH)/src/*.cpp):$(LOCAL_PATH)/%=%)

LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(JRTP_PATH)/include $(LOCAL_PATH)/$(JRTP_PATH)/src

LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)

LOCAL_CFLAGS += 	-DHAVE_TIME_H \
								-DHAVE_FCNTL_H \
                                -DHAVE_SYS_SELECT_H \
                                -DENABLE_TRACE \
                                -DHAVE_RTP_SUPPORT_IPV4MULTICAST\
                                -DOSIP_MT 
                                
LOCAL_STATIC_LIBRARIES := jthread 

LOCAL_PRELINK_MODULE := false

LOCAL_MODULE:= jrtp

include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)

LOCAL_MODULE := rtp
LOCAL_SRC_FILES := RTPRelated.cpp

LOCAL_CFLAGS += -DENABLE_TRACE

LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(JRTP_PATH)/include $(LOCAL_PATH)/$(JTHRD_PATH)/include  
 
LOCAL_STATIC_LIBRARIES := jthread jrtp

#LOCAL_JNI_SHARED_LIBRARIES := librtp

LOCAL_LDLIBS += -llog 
#				-L../../cxx-stl/stlport/libs/armeabi/libstlport_static.a

include $(BUILD_SHARED_LIBRARY)